package com.lantosec.hmrp.modules.internal.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.internal.vo.InternalLevelVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 评价等级定义 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class InternalLevel extends BaseEntity<InternalLevelVO> {

    private static final long serialVersionUID = 1L;
    public InternalLevel(InternalLevelVO vo){
        this.internalLevelId = vo.getInternalLevelId();
        this.internalLevelName = vo.getInternalLevelName();
        this.levelScore = vo.getLevelScore();
        this.necReason = vo.getNecReason();
    }

    @Override
    public InternalLevelVO convertToVO(){
        return new InternalLevelVO(this);
    }


    /**
     * 评价等级ID
     */
    @TableId(value = "internal_level_id", type = IdType.AUTO)
    private Integer internalLevelId;

    /**
     * 评价等级名称
     */
    private String internalLevelName;

    /**
     * 等级对应分值
     */
    private BigDecimal levelScore;

    /**
     * 评价理由是否必填（0否1是）
     */
    private Integer necReason;

    public enum ColName {
        internal_level_id, internal_level_name, level_scroe, necReason,
    }
}
